<template>
	<view class="main">
		<u-navbar :autoBack="true" rightText="完成" @rightClick="complete" :placeholder="true">
		</u-navbar>
		<view class="bigBox">
			<view class="img">
				<u--image height=4rem width=4rem src="http://182.61.31.180:5000/images/1655716309991_支付宝logo-圆形.png">
				</u--image>
			</view>
			<view class="text">
				<span>付款成功</span>
			</view>
			<view class="value">
				<span>{{ comprice }}元</span>
			</view>
		</view>
		<view class="payfor">
			<view>
				<span class="paymessage">商品信息</span>
				<sapn>{{ bookInfo }}</sapn>
			</view>
			<view>
				<span class="paymessage">付款信息</span>
				<span style="font-size: 1.1rem;">余额</span>
				<span style="font-size: 1.1rem;">-{{ comprice }}</span>
			</view>

		</view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			price: '',
			orderId: '',
			bookInfo: ''
		}
	},
	onLoad() {
		this.price = this.curOrder.price
		this.orderId = this.curOrder.orderId
		this.bookInfo = this.curOrder.bookTitle
	},
	computed: {
		curOrder() {
			return this.$store.state.order.curOrder
		},
		comprice() {
			return parseFloat(this.price).toFixed(2)
		},
	},
	methods: {
		complete() {
			this.$Router.replaceAll({
				name: 'home'
			})
		}
	}
}
</script>

<style lang="scss">
.main {
	background-color: white;

	.payfor {
		// margin-top: 0.2rem;
		margin-left: 1rem;
		margin-bottom: 0.5rem;
		display: flex;
		flex-direction: column;
		margin-right: 1rem;
		justify-content: space-between;

		view {
			display: flex;
			justify-content: space-between;
			padding-bottom: 0.5rem;
		}

		.paymessage {
			font-size: 1.2rem;
			color: #ccc;
		}
	}

	.bigBox {
		margin-top: 3rem;
		background-color: white;
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
		border-bottom: 0.5px solid #ccc;

		.img {}

		.text {
			margin-top: 1rem;
			color: #007aff;
		}

		.value {
			margin-top: 0.5rem;
			font-size: 2rem;

		}
	}
}
</style>
